/*
 * Update.h
 *
 *  Created on: Aug 29, 2016
 *      Author: ubuntu
 */

#ifndef UPDATE_H_
#define UPDATE_H_

#include <iostream>
using namespace std;

class DBPool;
class N900Resolve;
class G2OResolve;

class Update {
public:
	Update();
	virtual ~Update();

	static void *DMThread(void *arg);
	static void *NRsolveThread(void *arg);
	static void *GRsolveThread(void *arg);

	virtual bool init();
	virtual void start();
	virtual void stop();

protected:
	bool dminit();
	void dmrun();
	void dmread(int fd);
	void dmparse(unsigned char *buf, size_t len);
private:
	bool m_bTerminated;
	DBPool *m_pDBPool;
	N900Resolve *m_n900rsv;
	G2OResolve *m_g2orsv;

	int m_fd;
	int m_epfd;
	char *unix_path;
};



#endif /* DMUPDATE_H_ */
